﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Commons.Loading;

namespace CommonsTest
{
    [TestClass]
    public class UnitTest1
    {
        const string CHECK_DATA_BASE = "checkDataBase";
        const string SETTINGS = "settings";
        const string CONTEXT = "context";
        
        [TestMethod]
        public void TestMethod1()
        {
            LoadingContainerTask mainLoader = new LoadingContainerTask("Main", OnMainLoaderComplete);
            mainLoader.AddTask(CHECK_DATA_BASE, new CheckDataBaseTask());
            mainLoader.AddTask(SETTINGS, new SettingsLoadingTask(1.00f));
            mainLoader.AddTask(CONTEXT, new ContextLoadingTask(0.75f)).Requires(CHECK_DATA_BASE, SETTINGS);
            mainLoader.Start();
        }

        protected void OnMainLoaderComplete()
        {
             Debug.Log("Loading Complete");
        }
    }
}
